[NET] front: Fix features on resume when csum is off
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Wed, 16 Aug 2006 13:26:59 +0000 (14:26 +0100)
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Wed, 16 Aug 2006 13:26:59 +0000 (14:26 +0100)
When the netfront driver is resumed the features are renegotiated with
the backend.  However, I forgot take into account the status of the TX
checksum setting.  When TX checksum is disabled by the user, we cannot
enable SG or TSO since both require checksum offload.  This patch
makes
xennet check the checksum setting before renegotiating SG or TSO.

This bug was fixed thanks to a report from Anton Burtsev.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c

index d1c324db2b3f22a63d2758a9413644f58ba1022c..b2ca651773fb21f722e82b6333b1a22c654a4913 100644 (file)
@@ -1369,6 +1369,10 @@ static void xennet_set_features(struct net_device *dev)
        dev->features |= NETIF_F_GSO_ROBUST;
        xennet_set_sg(dev, 0);
 
+       /* We need checksum offload to enable scatter/gather and TSO. */
+       if (!(dev->features & NETIF_F_ALL_CSUM))
+               return;
+
        if (!xennet_set_sg(dev, 1))
                xennet_set_tso(dev, 1);
 }